home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / tpref.exe / TPR6.TXT < prev    next >
Text File  |  1992-10-19  |  59KB  |  1,595 lines

  1.                                    Chapter 6
  2.                                     of the
  3.                             Turbo Pascal Reference
  4.  
  5.                            The Turbo Vision Reference
  6.  
  7.  
  8. This chapter is part of the Turbo Pascal Reference electronic freeware book (C)
  9. Copyright 1992 by Ed Mitchell.  This freeware book contains supplementary
  10. material to Borland Pascal Developer's Guide, published by Que Corporation,
  11. 1992.  However, Que Corporation has no affiliation with nor responsibility for
  12. the content of this free book.  Please see Chapter 1 of the Turbo Pascal
  13. Reference for important information about your right to distribute and use this
  14. material freely.  If you find this material of use, I would appreciate your
  15. purchase of one my books, such as the Borland Pascal Developer's Guide or
  16. Secrets of the Borland C++ Masters, Sams Books, 1992.  Thank you.
  17.  
  18. For additional information on using Turbo Vision, including a detailed
  19. tutorial, please see Chapters 11 through 16 of the Borland Pascal Developer's
  20. Guide.
  21.  
  22.  
  23. About the Turbo Vision Reference
  24.  
  25.      The Turbo Vision Reference contains an alphabetized list of all Turbo
  26. Vision objects, global variables, procedures, functions, types and constant. 
  27. This reference is substantially different than Borland's reference because:
  28.  
  29.      1.  Where possible, example code that actually uses the object type is
  30.      shown.  Borland's documentation generally does not show sample code within
  31.      their Reference on Turbo Vision.
  32.  
  33.      2.  The reference includes all Turbo Vision features, including object
  34.      types, types, constants, variables, procedures and function.  All are
  35.      grouped together in one alphabetized section, unlike Borland's reference,
  36.      where you must look in several sections to find the desired item.
  37.  
  38.      3.  Most importantly, I have highlighted the methods that you are most
  39.      likely to use within each object type.  A problem with reading Borland's
  40.      documentation is that they present each object type followed by all twenty
  41.      to fifty possible methods within the object type.  In real applications,
  42.      though, you may only need to concern yourself with perhaps five to ten
  43.      methods.   Some of the variables and procedures are only useful to the
  44.      underlying implementation of Turbo Vision and may not be particularly
  45.      useful to your applications.  Nonetheless, these internal procedures,
  46.      where available, are included in the Reference and are designated as
  47.      "internal" procedures.
  48.  
  49.      When reading the Reference entires, keep in mind that since Turbo Vision
  50. objects are themselves usually derived from other Turbo Vision objects, it can
  51. be difficult to locate the definition of a particular method.  For example, you
  52. may see a procedure call such as,
  53.  
  54.      Shell.ReDraw;
  55.  
  56. where Shell is derived from TApplication.  You will need to look at the
  57. description of TProgram from which  TApplication  is derived, and then back to
  58. TView where you will finally locate the Redraw method. object which defines
  59. them.
  60.  
  61. Naming Conventions
  62.      Turbo Vision uses standardized naming conventions as an aid to making
  63. source code readable.  The most important conventions are:
  64. 1.   Type declarations begin with a capital letter T.
  65. 2.   Pointers to object types begin with a capital letter P.
  66. 3.   Registration records for stream I/O begin with a capital 
  67.      letter R.
  68. 4.   Except for color palette constants, identifiers beginning
  69.      with lower case letters are standard Turbo Vision constants.
  70.      The following table shows the standard constant prefix
  71.      characters:
  72.  
  73. Prefix  Definition               Example
  74.  
  75. ap      Application palette      apcolor
  76. bf      Button flag              bfdefault
  77. C       Color palettes           CListViewer
  78. cm      Command constant         cmok
  79. co      Collection codes         cooverflow
  80. dm      Drag mode                dmdraggrow
  81. ev      Event constant           evcommand
  82. gf      Grow mode flag           gfgrowall
  83. hc      Help context             hcnocontext
  84. kb      Keyboard code constant   kbalta
  85. mb      Mouse button constant    mbrightbutton
  86. of      Option flag              oftopselect
  87. P       Pointer equivalent       PCollection
  88. R       Registration record      RCollection
  89. sb      Scroll bar               sbrightarrow
  90. sf      State flag               sfactive
  91. sm      Screen mode constant     smfont8x8
  92. st      Stream code              stok
  93. T       Object type              TCollection
  94. wf      Window flags             wfmove
  95. wp      Window color palettes    wpbluewindow
  96.  
  97.  
  98.  
  99. The Turbo Vision Object Hierarchy
  100. --------------------------------
  101.      All Turbo Vision objects are descended from the TObject type.  All
  102. displayable objects are descendants of TView (which is itself descended from
  103. TObject).  Displayable objects include items such as dialogs, check boxes,
  104. buttons, windows and list boxes.  Non-displayable objects are the TCollection,
  105. TStream, TResourceFile, TStringList and TStrListMaker data structure objects.
  106.      The line of descent shown in the illustration, below, identifies how
  107. functionality is inherited between the objeccts.  For example, TDialog is
  108. descended from TWindow and inherits functionality from the TWindow object.   
  109.  
  110. Illustration showing inheritance relationships between the Turbo Vision object
  111. types.
  112.  
  113. TObject
  114.      TView
  115.           TBackground
  116.           TButton
  117.           TCluster
  118.               TCheckBoxes
  119.               TRadioButtons
  120.           TFrame
  121.           TGroup
  122.           TProgram
  123.               TApplication
  124.           TDeskTop
  125.           TWindow
  126.               TDialog
  127.               THistoryWindow
  128.           THistory
  129.           TInputLine
  130.           TListViewer
  131.               TListBox
  132.               THistoryViewer
  133.           TMenuView
  134.               TMenuBar
  135.               TMenuBox
  136.           TScroller
  137.               TTextDevice
  138.               TTerminal
  139.           TScrollBar
  140.           TStaticText
  141.               TLabel
  142.               TParamText
  143.           TStatusLine
  144.      TCollection
  145.           TSortedCollection
  146.           TStringCollection
  147.           TResourceCollection
  148.      TStream
  149.           TDosStream
  150.               TBufStream
  151.           TEmsStream
  152.      TResourceFile
  153.      TStringList
  154.      TStrListMaker
  155.  
  156.  
  157. Turbo Vision Object Descriptions
  158.  
  159.      The following reference section contains each procedure, function,
  160. variable, type and constant declaration defined in Turbo Vision, plus each of
  161. the primary Turbo Vision objects.  For the object descriptions, the information
  162. as organized into sections:
  163.  
  164. Turbo Vision Hierarchy
  165.      This section displays the derivation order of each object to help you
  166.      understand how functionally has been inherited from parent to descendant. 
  167.      For example, the TMenuBar object's derivation is indicated by this
  168.      drawing:
  169.  
  170.             TObject
  171.                TView
  172.                  TMenuView
  173.                                  TMenuBar
  174.  
  175.      This shows that TMenuBar is a descendant of TMenuView, which is a
  176.      descendant of TView, which is a descendant of TObject.
  177.  
  178. Discussion
  179.      A brief overview of the purpose of each object is given in this section.
  180.  
  181. Commonly Used Features
  182.      This section summarizes the primary methods that your applications will
  183.      likely use so that you will not need to spend much time attempting to
  184.      understand the other facilities of the object.  Many Turbo Vision objects
  185.      have a large variety of fields and methods available for use.  However,
  186.      many of these are needed only for the implementation of Turbo Vision
  187.      itself, and in most practical applications you will only need to reference
  188.      a small selection of the fields and methods.
  189.  
  190. Example
  191.      Where appropriate, a typical example usage of the object is given here.
  192.  
  193. Fields
  194.      Each field is described.  After the field's definition, a comment
  195.      indicating { Read only } or { Read/Write } indicates whether or not its
  196.      okay to directly access this field.
  197.  
  198. Methods
  199.      Every method defined for the object is presented in this section.